﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace StoreWeb
{
    public partial class welcome : System.Web.UI.Page
    {
        BLL.News news = new BLL.News();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (new Maticsoft.BLL.UserAdmin().GetModel(Convert.ToInt32(Request.Cookies["UserLogin"].Values[0])).loginname == "admin")
                {//管理员可以查看所有
                    Repeater1.DataSource = news.GetList(5, "", "createtime desc ");
                }
                else
                {
                    Repeater1.DataSource = news.GetList(5, " showobject=0 or showobject=" + Convert.ToInt32(Request.Cookies["UserLogin"].Values[0]) + " ", "createtime desc ");
                }
                Repeater1.DataBind();
            }
        }
    }
}